//import java.util.Scanner;
//
//// 父类 Employee
//class Employee1 {
//    private String name;
//    private int birthMonth;
//
//    public Employee1(String name, int birthMonth) {
//        this.name = name;
//        this.birthMonth = birthMonth;
//    }
//
//    public int getSalary(int month) {
//        int salary = 0;
//        if (month == birthMonth) {
//            salary += 100;
//        }
//        return salary;
//    }
//
//    public String getName() {
//        return name;
//    }
//}
//
//// 子类 SalariedEmployee，拿固定工资的员工
//class SalariedEmployee extends Employee {
//    private int monthlySalary;
//
//    public SalariedEmployee(String name, int birthMonth, int monthlySalary) {
//        super(name, birthMonth);
//        this.monthlySalary = monthlySalary;
//    }
//
//    @Override
//    public int getSalary(int month) {
//        int salary = super.getSalary(month);
//        salary += monthlySalary;
//        return salary;
//    }
//}
//
//// 子类 HourlyEmployee，按小时拿工资的员工
//class HourlyEmployee extends Employee {
//    private double hourlyWage;
//    private int hoursWorked;
//
//    public HourlyEmployee(String name, int birthMonth, double hourlyWage, int hoursWorked) {
//        super(name, birthMonth);
//        this.hourlyWage = hourlyWage;
//        this.hoursWorked = hoursWorked;
//    }
//
//    @Override
//    public int getSalary(int month) {
//        int salary = super.getSalary(month);
//        if (hoursWorked > 160) {
//            salary += (hoursWorked - 160) * (int) (hourlyWage * 1.5);
//        }
//        salary += 160 * (int) hourlyWage;
//        return salary;
//    }
//}
//
//// 子类 SalesEmployee，销售人员，工资由月销售额和提成率决定
//class SalesEmployee extends Employee {
//    private double monthlySales;
//    private double commissionRate;
//
//    public SalesEmployee(String name, int birthMonth, double monthlySales, double commissionRate) {
//        super(name, birthMonth);
//        this.monthlySales = monthlySales;
//        this.commissionRate = commissionRate;
//    }
//
//    @Override
//    public int getSalary(int month) {
//        int salary = super.getSalary(month);
//        salary += (int) (monthlySales * commissionRate);
//        return salary;
//    }
//}
//
//// 子类 BasePlusSalesEmployee，有固定底薪的销售人员
//class BasePlusSalesEmployee extends SalesEmployee {
//    private int baseSalary;
//
//    public BasePlusSalesEmployee(String name, int birthMonth, double monthlySales, double commissionRate, int baseSalary) {
//        super(name, birthMonth, monthlySales, commissionRate);
//        this.baseSalary = baseSalary;
//    }
//
//    @Override
//    public int getSalary(int month) {
//        int salary = super.getSalary(month);
//        salary += baseSalary;
//        return salary;
//    }
//}
//
//public class Test {
//    public static void main(String[] args) {
//        // 创建 Employee 类型的数组
//        Employee1[] employees = new Employee1[5];
//
//        // 创建不同类型的员工对象并放入数组
//        employees[0] = new SalariedEmployee("张三", 5, 8000);
//        employees[1] = new HourlyEmployee("李四", 7, 30.0, 180);
//        employees[2] = new SalesEmployee("王五", 9, 50000.0, 0.1);
//        employees[3] = new BasePlusSalesEmployee("赵六", 11, 80000.0, 0.15, 3000);
//
//        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入要计算工资的月份：");
//        int month = scanner.nextInt();
//
//        // 打印每个员工该月的工资
//        for (Employee employee : employees) {
//            System.out.println(employee.getName() + " 该月的工资为：" + employee.getSalary(month));
//        }
//    }
//}